_sync() {
if (this.radioMode) {
- this._label.text = this._connection.get_id();
+ this._label.text = this.name;
this.accessible_role = Atk.Role.CHECK_MENU_ITEM;
} else {
this._label.text = this._getRegularLabel();
}
});
+const NMDeviceConnectionItem = GObject.registerClass({
+ Properties: {
+ 'device-name': GObject.ParamSpec.string('device-name', '', '',
+ GObject.ParamFlags.READWRITE,
+ ''),
+ },
+}, class NMDeviceConnectionItem extends NMConnectionItem {
+ constructor(section, connection) {
+ super(section, connection);
+
+ this.connectObject(
+ 'notify::radio-mode', () => this.notify('name'),
+ 'notify::device-name', () => this.notify('name'),
+ this);
+ }
+
+ get name() {
+ return this.radioMode
+ ? this._connection.get_id()
+ : this.deviceName;
+ }
+});
+
var NMConnectionSection = class NMConnectionSection extends Signals.EventEmitter {
constructor(client) {
super();
}
_iconChanged() {
+ this._connectionItems.forEach(
+ item => (item.icon_name = this.getIndicatorIcon()));
this._sync();
this.emit('icon-changed');
}
return this._device.connection_valid(connection);
}
+ _makeConnectionItem(connection) {
+ return new NMDeviceConnectionItem(this, connection);
+ }
+
activateConnection(connection) {
this._client.activate_connection_async(connection, this._device, null, null, null);
}
setDeviceName(name) {
this._deviceName = name;
+ this._connectionItems.forEach(
+ item => (item.deviceName = this._getDescription()));
this._sync();
}
GObject.BindingFlags.SYNC_CREATE);
}
- get name() {
- return this._connection?.get_id() ?? '';
- }
-
_updateOrnament() {
this.setOrnament(PopupMenu.Ornament.NONE);
}
return 'network-vpn-disabled-symbolic';
}
}
+
+ set icon_name(_ignored) {
+ }
});
var NMVpnSection = class extends NMConnectionSection {